<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <sx:head parseContent="true"/>
    <title>My JSP 'employee.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script src="css/SpryTabbedPanels.js" type="text/javascript"></script>
    <link href="css/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
  </head>
  
  <body>
<div id="TabbedPanels1" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab">查询员工表
    </li>
    <li class="TabbedPanelsTab">添加员工表</li>
  </ul>
  <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent">
    	 <center>
    <form action="Employee_execute" method="post">
    <select name="select" id="select">
    <s:if test="select==null || select==''">
    	<option value="" >全部</option>
    	<option value="用户名">用户名</option>
  		<option value="工号">工号</option>
  		<option value="用户姓名">用户姓名</option>
  		<option value="用户性别">用户性别</option>
  		<option value="部门">部门</option>
  		<option value="职位">职位</option>
    </s:if>
    <s:elseif test="select=='用户名'">
    	<option value="" >全部</option>
    	<option value="用户名" selected="selected">用户名</option>
  		<option value="工号">工号</option>
  		<option value="用户姓名">用户姓名</option>
  		<option value="用户性别">用户性别</option>
  		<option value="部门">部门</option>
  		<option value="职位">职位</option>
    </s:elseif>
  	<s:elseif test="select =='工号'">
  		<option value="" >全部</option>
    	<option value="用户名" >用户名</option>
  		<option value="工号" selected="selected">工号</option>
  		<option value="用户姓名">用户姓名</option>
  		<option value="用户性别">用户性别</option>
  		<option value="部门">部门</option>
  		<option value="职位">职位</option>
  	</s:elseif>
  	<s:elseif test="select =='用户姓名'">
  		<option value="" >全部</option>
    	<option value="用户名">用户名</option>
  		<option value="工号">工号</option>
  		<option value="用户姓名" selected="selected">用户姓名</option>
  		<option value="用户性别">用户性别</option>
  		<option value="部门">部门</option>
  		<option value="职位">职位</option>
  	</s:elseif>
  	<s:elseif test="select =='用户性别'">
  		<option value="" >全部</option>
    	<option value="用户名">用户名</option>
  		<option value="工号">工号</option>
  		<option value="用户姓名">用户姓名</option>
  		<option value="用户性别" selected="selected">用户性别</option>
  		<option value="部门">部门</option>
  		<option value="职位">职位</option>
  	</s:elseif>
  	<s:elseif test="select =='部门'">
  		<option value="" >全部</option>
    	<option value="用户名">用户名</option>
  		<option value="工号">工号</option>
  		<option value="用户姓名">用户姓名</option>
  		<option value="用户性别">用户性别</option>
  		<option value="部门" selected="selected">部门</option>
  		<option value="职位">职位</option>
  	</s:elseif>
  	<s:elseif test="select =='职位'">
  		<option value="" >全部</option>
    	<option value="用户名">用户名</option>
  		<option value="工号">工号</option>
  		<option value="用户姓名">用户姓名</option>
  		<option value="用户性别">用户性别</option>
  		<option value="部门">部门</option>
  		<option value="职位" selected="selected">职位</option>
  	</s:elseif>
	</select>
		<input name="condition" type="text" size="20" value="${condition}" />
		<input type="submit"  value="提交" />
		</form>
		</center>
      <table width="100%" border="1">
        <tr>
          <th scope="col">用户名</th>
          <th scope="col">工号</th>
          <th scope="col">用户姓名</th>
          <th scope="col">用户性别</th>
          <th scope="col">部门</th>
          <th scope="col">职位</th>
          <th scope="col">用户手机</th>
          <th scope="col">用户QQ</th>
          <th scope="col">固定电话</th>
          <th scope="col">权限组</th>
          <th scope="col">生日</th>
          <th scope="col">操作</th>
        </tr>
        
        <s:iterator value="employees" id="employee">
        <tr>
          <td><s:property value="#employee.userName"/></td>
          <td><s:property value="#employee.jobNumber"/></td>
          <td><s:property value="#employee.usertrueName"/></td>
          <td>
          <s:if test="#employee.usersex">
         	 男
          </s:if>
          <s:else>
       		   女
          </s:else>
          </td>
          <td><s:property value="#employee.department.departmentName"/></td>
          <td><s:property value="#employee.post.postName"/></td>
          <td><s:property value="#employee.mobilePhone"/></td>
          <td><s:property value="#employee.userQq"/></td>
          <td><s:property value="#employee.phone"/></td>
          <td><s:property value="#employee.rightGroups.rightContext"/></td>
          <td>
          <s:date name="#employee.brithday" format="yyyy-MM-dd" var="d"/>
          <s:property value="#d"/>
          </td>
          <td>
          <table width="100%">
          <tr>
          <td>
          <form action="Employee_getById" method="post">
          	  <input type="hidden" name="userId" value="${employee.id}"/>
           <input type="submit" value="修改"/>
          </form>
          </td>
          <td>
          	<form action="Employee_delete" method="post">
          	 	<input type="hidden" name="employee.id" value="${employee.id}"/>
          	 <input type="submit" value="删除"/>
          </form>
          </td>
          </tr>
     		</table>
          </td>
        </tr>
        </s:iterator>
        <tr>
          <td colspan="12" align="center">
          <form action="Employee_fenye" method="post">
          <s:if test="page!=1">
          	<a href="Employee_fenye?page=1">首页</a>
          	 <a href="Employee_fenye?page=${page-1}">上页 </a>
          </s:if>
          <s:if test="page!=sumPage">
          	 <a href="Employee_fenye?page=${page+1}">下页</a> 
          	<a href="Employee_fenye?page=${sumPage}">尾页</a>
          </s:if>
          	  页次${page}/${sumPage}   共有 ${sum}条数据     跳到
            <select name="page" >
            <s:iterator begin="1" end="sumPage">
              <option value="<s:property/>"><s:property/></option>
              </s:iterator>
            </select>
            <input type="submit" value="跳转">
            </form>
          </td>
        </tr>
      </table>
    </div>
    <div class="TabbedPanelsContent">
      <form  method="post" action="Employee_Add">
        <table width="100%" border="1">
          <tr>
            <th scope="row">用户名：</th>
            <td>
            <input type="text" name="employee.userName"/></td>
          </tr>
          <tr>
            <th scope="row">密码：</th>
            <td>
            <input type="password" name="employee.userPwd"/>
            </td>
          </tr>
          <tr>
            <th scope="row">确认密码：</th>
            <td>
            <input type="password" name="pwd"/></td>
          </tr>
          <tr>
            <th scope="row">工号：</th>
            <td>
            <input type="text" name="employee.jobNumber"/></td>
          </tr>
          <tr>
            <th scope="row">用户姓名：</th>
            <td>
            <input type="text" name="employee.usertrueName" /></td>
          </tr>
          <tr>
            <th scope="row">用户性别：</th>
            <td>
              <input type="radio" name="employee.usersex" value="true" checked="checked"/>男
              <input type="radio" name="employee.usersex" value="false" />女
            </td>
          </tr>
          <tr>
            <th scope="row">部门：</th>
            <td>
              <select name="employee.department.departmentId">
               	<s:iterator value="departments" id="department">
                <option value="${department.departmentId}">${department.departmentName}</option>
                </s:iterator>
            </select>
            </td>
          </tr>
          <tr>
            <th scope="row">职位:</th>
            <td>
              <select name="employee.post.postId">
               	<s:iterator value="posts" id="post">
                <option value="${post.postId}">${post.postName}</option>
                </s:iterator>
            </select>
            </td>
          </tr>
          <tr>
            <th scope="row">用户手机:</th>
            <td>
            <input type="text" name="employee.mobilePhone"/></td>
          </tr>
          <tr>
            <th scope="row">用户QQ:</th>
            <td>
            <input type="text" name="employee.userQq"/></td>
          </tr>
          <tr>
            <th scope="row">固定电话:</th>
            <td>
            <input type="text" name="employee.phone"/></td>
          </tr>
          <tr>
            <th scope="row">权限组:</th>
            <td>
            <select name="employee.rightGroups.rightGroupsId">
               	<s:iterator value="rightGroups" id="rightGroup">
                <option value="${rightGroup.rightGroupsId}">${rightGroup.rightContext}</option>
                </s:iterator>
            </select>
			</td>
          </tr>
          <tr>
            <th scope="row">生日:</th>
            <td>
              <sx:datetimepicker
			            label=""
			            name="employee.brithday"
			            key="employee.brithday"
			             />
            </td>
          </tr>
          <tr>
          <td colspan="2" align="center">
          <input type="submit" value="提交"/>
          <input type="reset" value="重置"/>
          </td>
          </tr>
        </table>
      </form>
    </div>
  </div>
</div>
<script type="text/javascript">
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
</script>
</body>
</html>
